#include "Jeopardy.h"

//Screen attributes
const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;
const int SCREEN_BPP = 32;

SDL_Surface *screen = NULL;
SDL_Surface *JeopardyTV = NULL;

//The seEvent structure
SDL_Event seEvent;

int main(int argc, char** argv)
{
	Jeopardy thegame;

	Button JeopardyScreen(0, 0, 640, 480);
	Button JeopardyScreen2(320, 240, 640, 480);
	Button JeopardyScreen3(320, 0, 640, 480);
	Button JeopardyScreen4(0, 240, 640, 480);

	screen = init(screen, SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP);
	//thegame.createqanda();
	thegame.playgame();
	thegame.checkandprintresults();

	JeopardyScreen .load_buttonimage("Jeopardy.png");
	JeopardyScreen2.load_buttonimage("Jeopardy.png");
	JeopardyScreen3.load_buttonimage("Jeopardy.png");
	JeopardyScreen4.load_buttonimage("Jeopardy.png");

	bool done = false;

	while(!done)
	{
		while(SDL_PollEvent (&seEvent))
		{
			if (seEvent.type == SDL_QUIT)
			{
				done = true;
			}
			JeopardyScreen.handle_seEvents(&seEvent);
			JeopardyScreen2.handle_seEvents(&seEvent);
			JeopardyScreen3.handle_seEvents(&seEvent);
			JeopardyScreen4.handle_seEvents(&seEvent);
		}
	JeopardyScreen.show(screen);
	JeopardyScreen2.show(screen);
	JeopardyScreen3.show(screen);
	JeopardyScreen4.show(screen);
	SDL_Flip(screen);

		if(JeopardyScreen.is_buttondown())
		{
			return true;
		}
		if(JeopardyScreen2.is_buttondown())
		{
			return true;
		}
		if(JeopardyScreen3.is_buttondown())
		{
			return true;
		}
		if(JeopardyScreen4.is_buttondown())
		{
			return true;
		}

	}
	return 0;
}